package com.pan.note;

import com.pan.note.dao.UserDao;
import com.pan.note.mapper.UserMapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class test {
    @Autowired
    private UserMapper userMapper;

    private static final Logger logger = LogManager.getLogger(test.class);

    @Test
    public void addUser(){
        String[] userName={"刘华强","宋老虎","枕套","瓜摊老板","萨日朗"};
        String[] accountId={"11716","11717","11718","11719","11720"};
        for (int i = 0; i < userName.length; i++) {
            UserDao userDto = new UserDao();
            userDto.setAccountId(accountId[i]);
            userDto.setUserName(userName[i]);
            userDto.setUserPassword("111");
            userDto.setUserStatus("0");
            userDto.setDeleteFlag("0");
            userDto.setUserType("0");
            userMapper.insert(userDto);
        }
    }
}
